#include "DetourProximityGrid.h"
#ifdef __cplusplus
extern "C" {
#endif
void nav_dtProximityGrid_addItem(dtProximityGrid * c_this,unsigned short const id,float const minx,float const miny,float const maxx,float const maxy){
	unsigned short const c_arg_id=id;
	float const c_arg_minx=minx;
	float const c_arg_miny=miny;
	float const c_arg_maxx=maxx;
	float const c_arg_maxy=maxy;
	c_this->addItem(c_arg_id,c_arg_minx,c_arg_miny,c_arg_maxx,c_arg_maxy);
}

void nav_dtProximityGrid_clear(dtProximityGrid * c_this){
	c_this->clear();
}

void nav_dtProximityGrid_Delete(dtProximityGrid * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_dtProximityGrid_DeleteArray(dtProximityGrid * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

dtProximityGrid * nav_NewdtProximityGrid(){
	dtProximityGrid* wrap_out = new dtProximityGrid();
	return wrap_out;
}

int const * nav_dtProximityGrid_getBounds(dtProximityGrid const * c_this){
	int const * c_out = c_this->getBounds();
	int const * wrap_out  = (int const *)(void*)(c_out);
	return wrap_out;
}

float nav_dtProximityGrid_getCellSize(dtProximityGrid const * c_this){
	float c_out = c_this->getCellSize();
	float wrap_out  = (c_out);
	return wrap_out;
}

int nav_dtProximityGrid_getItemCountAt(dtProximityGrid const * c_this,int const x,int const y){
	int const c_arg_x=x;
	int const c_arg_y=y;
	int c_out = c_this->getItemCountAt(c_arg_x,c_arg_y);
	int wrap_out  = (c_out);
	return wrap_out;
}

dtProximityGrid * nav_dtProximityGrid_IndexArray(dtProximityGrid * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

bool nav_dtProximityGrid_init(dtProximityGrid * c_this,int const poolSize,float const cellSize){
	int const c_arg_poolSize=poolSize;
	float const c_arg_cellSize=cellSize;
	bool c_out = c_this->init(c_arg_poolSize,c_arg_cellSize);
	bool wrap_out  = (c_out);
	return wrap_out;
}

int nav_dtProximityGrid_queryItems(dtProximityGrid const * c_this,float const minx,float const miny,float const maxx,float const maxy,unsigned short * ids,int const maxIds){
	float const c_arg_minx=minx;
	float const c_arg_miny=miny;
	float const c_arg_maxx=maxx;
	float const c_arg_maxy=maxy;
	unsigned short * c_arg_ids=(unsigned short *)(void*)(ids);
	int const c_arg_maxIds=maxIds;
	int c_out = c_this->queryItems(c_arg_minx,c_arg_miny,c_arg_maxx,c_arg_maxy,c_arg_ids,c_arg_maxIds);
	int wrap_out  = (c_out);
	return wrap_out;
}

dtProximityGrid * nav_dtAllocProximityGrid(){
	dtProximityGrid * c_out = dtAllocProximityGrid();
	dtProximityGrid * wrap_out  = (dtProximityGrid *)(void*)(c_out);
	return wrap_out;
}

void nav_dtFreeProximityGrid(dtProximityGrid * ptr){
	dtProximityGrid * c_arg_ptr=(dtProximityGrid *)(void*)(ptr);
	dtFreeProximityGrid(c_arg_ptr);
}

dtProximityGrid * nav_NewDtProximityGridPtrArray(long n){
	dtProximityGrid* c_this=new dtProximityGrid[n];
	return c_this;
}

#ifdef __cplusplus
}
#endif
